cmake_minimum_required(VERSION 2.8)

SET(PRJ_NAME 				freetds-samples)

SET(PRJ_ROOTDIR				${CMAKE_CURRENT_SOURCE_DIR} )

PROJECT(${PRJ_NAME} 		C CXX)

MESSAGE(STATUS "Building freetds samples.")

INCLUDE_DIRECTORIES( 
	"${PRJ_ROOTDIR}"
)

## gcc sample3.c -L/usr/lib64 -lsybdb -o sample3
LINK_DIRECTORIES(
	"/usr/lib64"											#freetds
)
	
	SET(cflags	-std=gnu99)
	ADD_DEFINITIONS(${cflags})

	SET(SRCLIST_logsplit
		${PRJ_ROOTDIR}/tds_conn.c
		${PRJ_ROOTDIR}/tds_select.c
		${PRJ_ROOTDIR}/tab_write.c
		${PRJ_ROOTDIR}/samples/sample1.c
	)
	ADD_EXECUTABLE(sample1  ${SRCLIST_logsplit} )
	TARGET_LINK_LIBRARIES(sample1  -lsybdb )
